﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RoekScissorPaper
{
    public class Computer
    {
        //随机出拳，保存在属性中
        public EnumFist Fist { get; set; }
        //随机出拳
        public EnumFist ShowFist()
        {
            var rmd = new Random();
            int rNum = rmd.Next(1, 4);
            switch (rNum)
            {
                case 1:
                    this.Fist = EnumFist.石头;
                    break;
                case 2:
                    this.Fist = EnumFist.剪刀;
                    break;
                case 3:
                    this.Fist = EnumFist.布;
                    break;
                default:
                    return EnumFist.石头;
            }
            return (EnumFist)rNum;
        }
    }
}
